package com.baselibrary.test.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.baselibrary.libs.Utils.UtilsView.UtilsView;
import com.baselibrary.libs.View.defined.defined_viewpager.Defined_ViewPager;
import com.baselibrary.libs.View.defined.defined_viewpager.fragment.Fragment_item_01;
import com.baselibrary.libs.View.defined.defined_viewpager.fragment.Fragment_item_02;
import com.baselibrary.libs.View.defined.defined_viewpager.fragment.Fragment_item_03;
import com.baselibrary.libs.View.defined.defined_viewpager.fragment.Fragment_item_04;
import com.baselibrary.libs.base.baseActivity.BaseActivity;
import com.baselibrary.test.R;
import com.baselibrary.test.app.AppContext;

import java.util.ArrayList;


public class Down_Up_Activity extends BaseActivity implements View.OnClickListener {

    private TextView tv1;
    private RelativeLayout activity_down__up_;
    private Defined_ViewPager mDefined_viewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public int getlayouXML() {
        return R.layout.activity_down__up_;
    }

    @Override
    public void initP() {

    }

    @Override
    public void initView() {
        mDefined_viewPager = (Defined_ViewPager)findViewById(R.id.defined_ViewPager);
        tv1 = (TextView) findViewById(R.id.tv1);
        tv1.setOnClickListener(this);


        initData();
    }

    @Override
    public void initData() {
        Fragment_item_01 item_01 = new Fragment_item_01();
        Fragment_item_02 item_02 = new Fragment_item_02();
        Fragment_item_03 item_03 = new Fragment_item_03();
        Fragment_item_04 item_04 = new Fragment_item_04();
        ArrayList<Fragment> fragments = new ArrayList<>();
        fragments.add(item_01);
        fragments.add(item_02);
        fragments.add(item_03);
        fragments.add(item_04);
        mDefined_viewPager.setData(getSupportFragmentManager(),fragments);

        UtilsView.setViewSize(AppContext.getApplication(),mDefined_viewPager,50,100);
    }

    @Override
    public void initListener() {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv1:
                Intent intent = new Intent();
                Bundle bundle = new Bundle();
                bundle.putString("2","2");
                intent.putExtras(bundle);
                setResult(100,intent);
                finish();
            break;
        }
    }
}
